***************************************************************
*** SUMMARY STATS FOR PATIENTS WITH INPATIENT STAYS IN 2010	***
*** Last edited: 3/8/2022                       			***
***************************************************************

capture log close
log using "${CodePath}/log/medpar_summarystats_2010_$S_DATE.log", text replace

*--------------------------------------------------
* Overall summary
*--------------------------------------------------
use "${DataPath}/claims/ip100pct_withccs_2010.dta", clear

estpost summarize age_disch female sinceIP_30 sinceIP_60 sinceIP_90 white, listwise
eststo inpatient_2010

*--------------------------------------------------
* Border hospitals summary (within 100 miles)
*--------------------------------------------------
estpost summarize age_disch female sinceIP_30 sinceIP_60 sinceIP_90 white  if within100m == 1, listwise
eststo inpatient_within100_2010

esttab using "${OutputPath}/Summary Statistics/medpar_summarystats_2010.tex", replace ///
		cells("mean(fmt(2))" "sd(par fmt(2))")  mtitles("All" "Border Sample" ) unstack sfmt(%9.1f) label

log close
